-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
distribute framework: add planner #46395
Conversation
/hold wip |
Hi @GMHDBJD. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #46395 +/- ##
================================================
- Coverage 73.3422% 72.8209% -0.5213%
================================================
Files 1310 1335 +25
Lines 395127 403506 +8379
================================================
+ Hits 289795 293837 +4042
- Misses 86876 91197 +4321
- Partials 18456 18472 +16
Flags with carried forward coverage won't be shown. Click here to find out more.
|
/unhold |
/retest |
@GMHDBJD: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/ok-to-test |
/test tiprow_fast_test |
@GMHDBJD: The specified target(s) for
The following commands are available to trigger optional jobs:
Use
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/cc @ywqzzy |
if err != nil { | ||
return nil, err | ||
} | ||
gTask.Step = nextStep |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can do gtask.Step++ in dispatcher after calling processNormalFlow.
Anyway, this refinement can be done later.
physicalPlan := &planner.PhysicalPlan{} | ||
inputStreams := make([]planner.StreamSpec, 0) | ||
// physical plan only needs to be generated once. | ||
// However, our current implementation requires generating it for each step. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How can we generate the physical plan once? Next pr?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we support pass result from one step two another step, then we only need generated the initial physical plan, all runtime arguments should be define in input stream and generate in executor instead
JobID int64 | ||
Plan importer.Plan | ||
Stmt string | ||
EligibleInstances []*infosync.ServerInfo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems useless?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tidb/disttask/importinto/job.go
Line 185 in 2564090
EligibleInstances: instances, |
|
||
// PreviousSubtaskMetas is a list of subtask metas from previous step. | ||
// We can remove this field if we find a better way to pass the result between steps. | ||
PreviousSubtaskMetas [][]byte |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hold task_table as member?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hold task_table as member?
The planner in tidb runtime also fetch meta data from tikv. So I think it's ok.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using PreviousSubtaskMetas is to express that PreviousSubtaskMetas is the result of the previous step. If we use task_table, our planner will be coupled with the system table again, although adding a new interface would be more convenient. 🤔
disttask/framework/planner/plan.go
Outdated
Streams []StreamSpec | ||
} | ||
|
||
// StreamSpec is the specification of a stream. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name is a little bit confusing, can we have a better name?
|
||
type mockPlan struct{} | ||
|
||
func (mockPlan) ToTaskMeta() ([]byte, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can use gen_mock introduced in #46392
store := testkit.CreateMockStore(t) | ||
gtk := testkit.NewTestKit(t, store) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems useless? Bootstrap a testkit cost some resource, better not add it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need testkit to submit a global task like what we do in handle_test
gtk := testkit.NewTestKit(t, store) |
} | ||
|
||
// PhysicalPlan is a DAG of processors in distribute framework. | ||
type PhysicalPlan struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add more detailed comments to show the arch of the planner?
/retest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/retest |
/test tiprow_fast_test |
@GMHDBJD: The specified target(s) for
The following commands are available to trigger optional jobs:
Use
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/test tiprow_fast_test |
@GMHDBJD: The specified target(s) for
The following commands are available to trigger optional jobs:
Use
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
type Planner struct{} | ||
|
||
// Run runs the distribute plan. | ||
func (*Planner) Run(planCtx PlanCtx, plan LogicalPlan) (int64, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No usage?
/retest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
5/13 review later
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: tangenta, ywqzzy The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest |
/retest |
@GMHDBJD: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
What problem does this PR solve?
Issue Number: ref #46258
Problem Summary:
What is changed and how it works?
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.